home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / PerfectPaint / rexx / Anim / CloneAnim2.rx < prev    next >
Encoding:
Text File  |  2002-03-13  |  1.6 KB  |  125 lines

  1. /*     arexx Script 
  2. */
  3.  
  4.     options results
  5.     parse ARG Port b
  6.     
  7.     ADDRESS value Port
  8.  
  9.     pp_GetDepth
  10.     D=result
  11.     pp_GetWidth
  12.     W=result
  13.     pp_GetHeight
  14.     H=result
  15.  
  16.     pp_CountFrames
  17.     count=result
  18.     IF count<2 then DO
  19.         pp_Warn 'Make*an*Anim*first.'
  20.         EXIT
  21.     END
  22.  
  23.     pp_GetCurrentBuffer
  24.     CBf=result
  25.     pp_GetCurrentBrush
  26.     B0=result
  27.  
  28.     if D<24 then DO
  29.         pp_Psave "ram:palette.trash" 0
  30.     END
  31.  
  32.     pp_FindEmptyBrush
  33.     Brush=result
  34.     if Brush=-1 then DO
  35.         pp_Warn "can't*find*empty|Brush."
  36.         EXIT        
  37.     END
  38.     pp_SetBrush Brush    
  39.  
  40.     pp_BufferGui "*SELECT*DESTINATION*"
  41.     flag=result
  42.     IF flag=-1 then DO
  43.         EXIT
  44.     END
  45.  
  46.     s0=1
  47.     s1=Count
  48.     ADDRESS value Port
  49.     pp_DialogInit 250 80 "*Clone*Anim*" 2
  50.         pp_Slider 0 100 5 100 16 "First*Frame*#" 1 1 count s0
  51.         pp_Slider 1 100 25 100 16 "Last*Frame*#" 1 1 count s1
  52.     pp_Dialog
  53.     rc=result
  54.     IF rc=0 THEN DO
  55.         EXIT
  56.     END
  57.  
  58.     pp_GetDialog 0
  59.     s0=result
  60.  
  61.     pp_GetDialog 1
  62.     s1=result
  63.     
  64.     pp_GotoFrame s0
  65.  
  66.     pp_SetBuffer flag
  67.     pp_GetWidth
  68.     if result~=0 then DO
  69.         pp_Request "This*Buffer*is*not*empty.|Do*you*want*to*erase*it*?"
  70.         if result=0 then DO
  71.             EXIT
  72.         END
  73.         ELSE DO
  74.             pp_ClearCurrentBuffer            
  75.         END
  76.     END    
  77.  
  78.     pp_new W H D
  79.     pp_GetWidth
  80.     IF result=0 then DO
  81.         pp_Warn "Not*enough*memory."
  82.         EXIT            
  83.     END
  84.  
  85.     IF D<24 then DO
  86.         pp_Pload "ram:palette.trash"
  87.         ADDRESS COMMAND
  88.         'delete >nil: ram:palette.trash'
  89.         ADDRESS value Port
  90.     END    
  91.  
  92.     pp_AnimGui 1
  93.     IF result<2 then DO
  94.         EXIT
  95.     END
  96.  
  97.     pp_MakeAnim (s1-s0)+1
  98.     pp_CountFrames
  99.     Count=result
  100.     IF Count<2 then DO
  101.         pp_Warn "Can't*create*animation."
  102.         EXIT
  103.     END
  104.  
  105.     pp_EffectOff
  106.     
  107.     DO i=1 to Count
  108.         pp_SetBuffer CBf
  109.         pp_PickBrush 0 0 W H 1
  110.         pp_NextFrame
  111.         pp_SetBuffer flag
  112.         pp_Plot W/2 H/2
  113.         pp_NextFrame        
  114.     END
  115.  
  116.     pp_FreeBrush
  117.     pp_SetBrush B0
  118.     
  119.     EXIT
  120.     
  121.  
  122.  
  123.     
  124.  
  125.